<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body>
        <script>
            const p = new Promise((resolve,reject)=>{
                setTimeout(()=>{
                    resolve("用户数据");
                    // reject("错误！");
                },1000)
            });

           const result = p.then((value)=>{
                // console.log(value);
                //1.非promise时，即为返回的值
                // return 123;
                //2.是promise对象时，为里面promise返回的值
                // return new Promise((resolve,reject)=>{
                //     resolve("ok!");
                // });
                //3.抛出错误
                // throw "这是错误！";
            },(reason)=>{
                // console.log(reason);
            });

            console.log(result);

        </script>
    </body>
</html>